/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.genew.squadra.xml.model.wellformed;

import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;

/**
 *
 * @author Mario
 */
public class MyErrorHandler implements org.xml.sax.ErrorHandler{//obbligatoria sennò non vediamo gli errori{
     
 
    public MyErrorHandler() {
    }

    @Override
    public void warning(SAXParseException exception) throws SAXException {
       
        System.err.println(
                "WARNING ("+exception.getSystemId()+":"+
                        exception.getLineNumber()+","+exception.getColumnNumber()+") "+
                        exception.getMessage());
    }

    @Override
    public void error(SAXParseException exception) throws SAXException {
         System.err.println(
                "non validato ("+exception.getSystemId()+":"+
                        exception.getLineNumber()+","+exception.getColumnNumber()+") "+
                        exception.getMessage());
        
    }

    @Override
    public void fatalError(SAXParseException exception) throws SAXException {//se il  documento non è ben formato

         System.err.println(
                "ERRORE FATALE ("+exception.getSystemId()+":"+
                        exception.getLineNumber()+","+exception.getColumnNumber()+") "+
                        exception.getMessage());
                        throw exception;
    
    }
    
    
    
    
}
